package com.ershu.role.dao;


import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import com.ershu.role.domain.Role;

import cn.itcast.jdbc.TxQueryRunner;

public class RoleDao {
	private QueryRunner qr = new TxQueryRunner();
	/**
	 * 
	 * @param id
	 * @return
	 * @author HaiShin
	 * 通过id找到身份
	 */
	public Role findById(String id){
		try {
			String sql = "select * from role where id = ? ";
			return qr.query(sql, new BeanHandler<Role>(Role.class),id);
		} catch (SQLException e) {
			// TODO: handle exception
			throw new RuntimeException(e);
		}
	}
}
